//
//  NSObject+Userdefault.m
//  WuJieLive
//
//  Created by 张瀚坤 on 2017/10/24.
//  Copyright © 2017年 zhk. All rights reserved.
//

#import "NSObject+Userdefault.h"

#define KEY_password @"password" // 密码

#define KEY_isLogin @"isLogin" // 是否登录

#define KEY_userName @"userName" // 用户名

#define KEY_telephoneNumber @"telephoneNumber"  // 电话号码

#define KEY_brithDay @"brithDay"  // 生日

#define KEY_payForPassword @"payForPassword" // 支付密码

#define Key_redisKey @"redisKey" // 跳转页面需要的key

#define Key_token @"token" // token

#define Key_serviceNum @"servicePhoneNum" // 客服电话

#define Key_QRcodeUrl @"QRcodeUrl" // 二维码URL

#define Key_userImageString @"userImageString" // 用户头像

#define Key_gender @"gender" // 用户性别

#define Key_region_id @"region_id" // 地区ID

#define Key_actuallyName @"actuallyName" // 实名认证

#define Key_starPhoneNumber @"starPhoneNumber" // 带星号的电话号码

#define Key_accountMoney @"accountMoney"  // 钱包余额

@implementation NSObject (Userdefault)

- (void)setAccountMoney:(NSString *)accountMoney
{
    [[NSUserDefaults standardUserDefaults] setObject:accountMoney forKey:Key_accountMoney];
}

-(NSString *)accountMoney
{
    return [[NSUserDefaults standardUserDefaults] objectForKey:Key_accountMoney];
}

-(void)setStarPhoneNumber:(NSString *)starPhoneNumber
{
    [[NSUserDefaults standardUserDefaults] setObject:starPhoneNumber forKey:Key_starPhoneNumber];
}

- (NSString *)starPhoneNumber
{
    return [[NSUserDefaults standardUserDefaults] objectForKey:Key_starPhoneNumber];
}

-(void)setActuallyName:(NSInteger)actuallyName
{
    [[NSUserDefaults standardUserDefaults] setInteger:actuallyName forKey:Key_actuallyName];
}

- (NSInteger)actuallyName
{
    return [[NSUserDefaults standardUserDefaults] integerForKey:Key_actuallyName];
}

-(void)setRegion_id:(NSInteger)region_id
{
    [[NSUserDefaults standardUserDefaults] setInteger:region_id forKey:Key_region_id];
}

-(NSInteger)region_id
{
    return [[NSUserDefaults standardUserDefaults] integerForKey:Key_region_id];
}

-(void)setGender:(NSInteger)gender
{
    [[NSUserDefaults standardUserDefaults] setInteger:gender forKey:Key_gender];
}

-(NSInteger)gender
{
    return [[NSUserDefaults standardUserDefaults] integerForKey:Key_gender];
}

-(void)setUserImageString:(NSString *)userImageString
{
    [[NSUserDefaults standardUserDefaults] setObject:userImageString forKey:Key_userImageString];
}

-(NSString *)userImageString
{
    return [[NSUserDefaults standardUserDefaults] objectForKey:Key_userImageString];
}


- (void)setQRcodeUrl:(NSString *)QRcodeUrl
{
    [[NSUserDefaults standardUserDefaults] setObject:QRcodeUrl forKey:Key_QRcodeUrl];
}

-(NSString *)QRcodeUrl
{
    return [[NSUserDefaults standardUserDefaults] objectForKey:Key_QRcodeUrl];
}

-(void)setServicePhoneNum:(NSString *)servicePhoneNum
{
    [[NSUserDefaults standardUserDefaults] setObject:servicePhoneNum forKey:Key_serviceNum];
}

-(NSString *)servicePhoneNum
{
    return [[NSUserDefaults standardUserDefaults] objectForKey:Key_serviceNum];
}

-(void)setUserToken:(NSString *)userToken
{
    [[NSUserDefaults standardUserDefaults] setObject:userToken forKey:Key_token];
}

- (NSString *)userToken
{
    return [[NSUserDefaults standardUserDefaults] objectForKey:Key_token];
}

- (void)setRedisKey:(NSString *)redisKey
{
    [[NSUserDefaults standardUserDefaults] setObject:redisKey forKey:Key_redisKey];
}

- (NSString *)redisKey
{
    return [[NSUserDefaults standardUserDefaults] objectForKey:Key_redisKey];
}

- (void)setIsLogin:(BOOL)isLogin
{
    [[NSUserDefaults standardUserDefaults] setBool:isLogin forKey:KEY_isLogin];
}

- (void)setPassword:(NSString *)password
{
    [[NSUserDefaults standardUserDefaults] setObject:password forKey:KEY_password];
}

- (void)setNickName:(NSString *)nickName
{
    [[NSUserDefaults standardUserDefaults] setObject:nickName forKey:KEY_userName];
}

- (void)setTelephoneNumber:(NSString *)telephoneNumber
{
    [[NSUserDefaults standardUserDefaults] setObject:telephoneNumber forKey:KEY_telephoneNumber];
}

- (NSString *)telephoneNumber
{
    return [[NSUserDefaults standardUserDefaults] objectForKey:KEY_telephoneNumber];
}

- (NSString *)nickName
{
    return [[NSUserDefaults standardUserDefaults] objectForKey:KEY_userName];
}

- (NSString *)password
{
    return [[NSUserDefaults standardUserDefaults] objectForKey:KEY_password];
}

- (BOOL)isLogin
{
    return [[NSUserDefaults standardUserDefaults] boolForKey:KEY_isLogin];
}


-(void)setBrithDay:(NSString *)brithDay
{
    [[NSUserDefaults standardUserDefaults] setObject:brithDay forKey:KEY_brithDay];
}

-(NSString *)brithDay
{
    return [[NSUserDefaults standardUserDefaults] objectForKey:KEY_brithDay];
}


- (void)setPayForPassword:(NSString *)payForPassword
{
    [[NSUserDefaults standardUserDefaults] setObject:payForPassword forKey:KEY_payForPassword];
}

- (NSString *)payForPassword
{
    return [[NSUserDefaults standardUserDefaults] objectForKey:KEY_payForPassword];
}

@end
